package com.welike.shibo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.welike.shibo.eneity.Zan;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created by fangyu on 2019-08-18.
 */
public interface ZanMapper extends BaseMapper<Zan> {

    // 查询是否存在点赞关系
    String queryIdByUserIdAndZanObjId(@Param("userId")String userId, @Param("zanObjId")String zanObjId);

    // 查询赞的次数通过对象id
    Integer countByZanObjId(@Param("zanObjId")String zanObjId);

    // 查看所有赞的次数
    Integer countByZan();

    IPage<Zan> queryZanInVidList(Page page, @Param("vidList")List<String> vidList);

}